//
//  YQLHttpHandler.h
//  SJZBusiness
//
//  Created by 位立志 on 2018/7/16.
//  Copyright © 2018年 bwton. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SJZCouponModel.h"

@interface YQLHttpHandler : NSObject

/**
 发送验证码
 
 @param phone       手机号
 @param completion  返回是否成功或者失败
 */
+ (void)sendCodeWithPhone:(NSString *)phone
               completion:(void (^)(BOOL isSuccess, NSString *errStr)) completion;


/**
 用户登录

 @param phone <#phone description#>
 @param code <#code description#>
 @param completion <#completion description#>
 */
+ (void)loginWithPhone:(NSString *)phone
                  code:(NSString *)code
            completion:(void (^)(BOOL isSuccess, NSString *errStr, SJZAccountModel *account)) completion;


/**
 分页查询核销的兑换券

 @param userId 用户id
 @param page     第几页
 @param length     每页数量
 @param voucherCode 兑换券码
 @param completion <#completion description#>
 */
+ (void)listConsumeVoucherWithuserId:(NSString *)userId
                                page:(NSString *)page
                              length:(NSString *)length
                         voucherCode:(NSString *)voucherCode
                          completion:(void (^)(NSArray *voucherArray, NSString *errStr)) completion;


/**
 统计核销的兑换券

 @param userId userId
 @param completion <#completion description#>
 */
+ (void)listStatConsumeVoucherWithuserId:(NSString *)userId
                              completion:(void (^)(NSArray *dictArray,NSString *dateRange,NSString *totalCount, NSString *errStr)) completion;


/**
 核销兑换券

 @param userId <#userId description#>
 @param voucherCode <#voucherCode description#>
 @param completion <#completion description#>
 */
+ (void)consumeVoucherWithuserId:(NSString *)userId
                     voucherCode:(NSString *)voucherCode
                      completion:(void (^)(SJZCouponModel *couponModel, NSString *errStr)) completion;
@end
